<?php
/**
 * Created by PhpStorm.
 * User: ciwei
 * Date: 2017/12/5
 * Time: 14:23
 */
namespace app\index\controller;



class Msg extends Common
{
    public function clearMsg()
    {
        $mid = input('mid');
        $res = db('msg')->delete($mid);
        if ($res){
            exit(json_encode(['error'=>0,'info'=>'成功']));
        }else{
            exit(json_encode(['error'=>1,'info'=>'失误']));
        }
    }
    public function clearAll()
    {
        $res = db('msg')->where('duid',session('uid'))->delete();
        if ($res){
            exit(json_encode(['error'=>0,'info'=>'成功']));
        }else{
            exit(json_encode(['error'=>1,'info'=>'失误']));
        }
    }
}